<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>DirectoryWalker (Apache Commons IO 2.5 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="DirectoryWalker (Apache Commons IO 2.5 API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/DirectoryWalker.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/commons/io/CopyUtils.html" title="class in org.apache.commons.io"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/commons/io/DirectoryWalker.CancelException.html" title="class in org.apache.commons.io"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/commons/io/DirectoryWalker.html" target="_top">Frames</a></li>
<li><a href="DirectoryWalker.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested_class_summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.io</div>
<h2 title="Class DirectoryWalker" class="title">Class DirectoryWalker&lt;T&gt;</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.commons.io.DirectoryWalker&lt;T&gt;</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public abstract class <span class="strong">DirectoryWalker&lt;T&gt;</span>
extends <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block">Abstract class that walks through a directory hierarchy and provides
 subclasses with convenient hooks to add specific behaviour.
 <p>
 This class operates with a <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io"><code>FileFilter</code></a> and maximum depth to
 limit the files and direcories visited.
 Commons IO supplies many common filter implementations in the
 <a href="filefilter/package-summary.html"> filefilter</a> package.
 <p>
 The following sections describe:
   <ul>
      <li><a href="#example">1. Example Implementation</a> - example
          <code>FileCleaner</code> implementation.</li>
      <li><a href="#filter">2. Filter Example</a> - using
          <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io"><code>FileFilter</code></a>(s) with <code>DirectoryWalker</code>.</li>
      <li><a href="#cancel">3. Cancellation</a> - how to implement cancellation
          behaviour.</li>
   </ul>

 <a name="example"></a>
 <h3>1. Example Implementation</h3>

 There are many possible extensions, for example, to delete all
 files and '.svn' directories, and return a list of deleted files:
 <pre>
  public class FileCleaner extends DirectoryWalker {

    public FileCleaner() {
      super();
    }

    public List clean(File startDirectory) {
      List results = new ArrayList();
      walk(startDirectory, results);
      return results;
    }

    protected boolean handleDirectory(File directory, int depth, Collection results) {
      // delete svn directories and then skip
      if (".svn".equals(directory.getName())) {
        directory.delete();
        return false;
      } else {
        return true;
      }

    }

    protected void handleFile(File file, int depth, Collection results) {
      // delete file and add to list of deleted
      file.delete();
      results.add(file);
    }
  }
 </pre>

 <a name="filter"></a>
 <h3>2. Filter Example</h3>

 Choosing which directories and files to process can be a key aspect
 of using this class. This information can be setup in three ways,
 via three different constructors.
 <p>
 The first option is to visit all directories and files.
 This is achieved via the no-args constructor.
 <p>
 The second constructor option is to supply a single <a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io"><code>FileFilter</code></a>
 that describes the files and directories to visit. Care must be taken
 with this option as the same filter is used for both directories
 and files.
 <p>
 For example, if you wanted all directories which are not hidden
 and files which end in ".txt":
 <pre>
  public class FooDirectoryWalker extends DirectoryWalker {
    public FooDirectoryWalker(FileFilter filter) {
      super(filter, -1);
    }
  }

  // Build up the filters and create the walker
    // Create a filter for Non-hidden directories
    IOFileFilter fooDirFilter =
        FileFilterUtils.andFileFilter(FileFilterUtils.directoryFileFilter,
                                      HiddenFileFilter.VISIBLE);

    // Create a filter for Files ending in ".txt"
    IOFileFilter fooFileFilter =
        FileFilterUtils.andFileFilter(FileFilterUtils.fileFileFilter,
                                      FileFilterUtils.suffixFileFilter(".txt"));

    // Combine the directory and file filters using an OR condition
    java.io.FileFilter fooFilter =
        FileFilterUtils.orFileFilter(fooDirFilter, fooFileFilter);

    // Use the filter to construct a DirectoryWalker implementation
    FooDirectoryWalker walker = new FooDirectoryWalker(fooFilter);
 </pre>
 <p>
 The third constructor option is to specify separate filters, one for
 directories and one for files. These are combined internally to form
 the correct <code>FileFilter</code>, something which is very easy to
 get wrong when attempted manually, particularly when trying to
 express constructs like 'any file in directories named docs'.
 <p>
 For example, if you wanted all directories which are not hidden
 and files which end in ".txt":
 <pre>
  public class FooDirectoryWalker extends DirectoryWalker {
    public FooDirectoryWalker(IOFileFilter dirFilter, IOFileFilter fileFilter) {
      super(dirFilter, fileFilter, -1);
    }
  }

  // Use the filters to construct the walker
  FooDirectoryWalker walker = new FooDirectoryWalker(
    HiddenFileFilter.VISIBLE,
    FileFilterUtils.suffixFileFilter(".txt"),
  );
 </pre>
 This is much simpler than the previous example, and is why it is the preferred
 option for filtering.

 <a name="cancel"></a>
 <h3>3. Cancellation</h3>

 The DirectoryWalker contains some of the logic required for cancel processing.
 Subclasses must complete the implementation.
 <p>
 What <code>DirectoryWalker</code> does provide for cancellation is:
 <ul>
    <li><a href="../../../../org/apache/commons/io/DirectoryWalker.CancelException.html" title="class in org.apache.commons.io"><code>DirectoryWalker.CancelException</code></a> which can be thrown in any of the
        <i>lifecycle</i> methods to stop processing.</li>
    <li>The <code>walk()</code> method traps thrown <a href="../../../../org/apache/commons/io/DirectoryWalker.CancelException.html" title="class in org.apache.commons.io"><code>DirectoryWalker.CancelException</code></a>
        and calls the <code>handleCancelled()</code> method, providing
        a place for custom cancel processing.</li>
 </ul>
 <p>
 Implementations need to provide:
 <ul>
    <li>The decision logic on whether to cancel processing or not.</li>
    <li>Constructing and throwing a <a href="../../../../org/apache/commons/io/DirectoryWalker.CancelException.html" title="class in org.apache.commons.io"><code>DirectoryWalker.CancelException</code></a>.</li>
    <li>Custom cancel processing in the <code>handleCancelled()</code> method.
 </ul>
 <p>
 Two possible scenarios are envisaged for cancellation:
 <ul>
    <li><a href="#external">3.1 External / Mult-threaded</a> - cancellation being
        decided/initiated by an external process.</li>
    <li><a href="#internal">3.2 Internal</a> - cancellation being decided/initiated
        from within a DirectoryWalker implementation.</li>
 </ul>
 <p>
 The following sections provide example implementations for these two different
 scenarios.

 <a name="external"></a>
 <h4>3.1 External / Multi-threaded</h4>

 This example provides a public <code>cancel()</code> method that can be
 called by another thread to stop the processing. A typical example use-case
 would be a cancel button on a GUI. Calling this method sets a
 <a href="http://java.sun.com/docs/books/jls/second_edition/html/classes.doc.html#36930">
 volatile</a> flag to ensure it will work properly in a multi-threaded environment.
 The flag is returned by the <code>handleIsCancelled()</code> method, which
 will cause the walk to stop immediately. The <code>handleCancelled()</code>
 method will be the next, and last, callback method received once cancellation
 has occurred.

 <pre>
  public class FooDirectoryWalker extends DirectoryWalker {

    private volatile boolean cancelled = false;

    public void cancel() {
        cancelled = true;
    }

    protected boolean handleIsCancelled(File file, int depth, Collection results) {
        return cancelled;
    }

    protected void handleCancelled(File startDirectory, Collection results, CancelException cancel) {
        // implement processing required when a cancellation occurs
    }
  }
 </pre>

 <a name="internal"></a>
 <h4>3.2 Internal</h4>

 This shows an example of how internal cancellation processing could be implemented.
 <b>Note</b> the decision logic and throwing a <a href="../../../../org/apache/commons/io/DirectoryWalker.CancelException.html" title="class in org.apache.commons.io"><code>DirectoryWalker.CancelException</code></a> could be implemented
 in any of the <i>lifecycle</i> methods.

 <pre>
  public class BarDirectoryWalker extends DirectoryWalker {

    protected boolean handleDirectory(File directory, int depth, Collection results) throws IOException {
        // cancel if hidden directory
        if (directory.isHidden()) {
            throw new CancelException(file, depth);
        }
        return true;
    }

    protected void handleFile(File file, int depth, Collection results) throws IOException {
        // cancel if read-only file
        if (!file.canWrite()) {
            throw new CancelException(file, depth);
        }
        results.add(file);
    }

    protected void handleCancelled(File startDirectory, Collection results, CancelException cancel) {
        // implement processing required when a cancellation occurs
    }
  }
 </pre></div>
<dl><dt><span class="strong">Since:</span></dt>
  <dd>1.3</dd>
<dt><span class="strong">Version:</span></dt>
  <dd>$Id: DirectoryWalker.java 1723627 2016-01-07 21:15:47Z niallp $</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested_class_summary">
<!--   -->
</a>
<h3>Nested Class Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Class and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/io/DirectoryWalker.CancelException.html" title="class in org.apache.commons.io">DirectoryWalker.CancelException</a></strong></code>
<div class="block">CancelException is thrown in DirectoryWalker to cancel the current
 processing.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier</th>
<th class="colLast" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected </code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/io/DirectoryWalker.html#DirectoryWalker()">DirectoryWalker</a></strong>()</code>
<div class="block">Construct an instance with no filtering and unlimited <i>depth</i>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected </code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/io/DirectoryWalker.html#DirectoryWalker(java.io.FileFilter,%20int)">DirectoryWalker</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;filter,
               int&nbsp;depthLimit)</code>
<div class="block">Construct an instance with a filter and limit the <i>depth</i> navigated to.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected </code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/io/DirectoryWalker.html#DirectoryWalker(org.apache.commons.io.filefilter.IOFileFilter,%20org.apache.commons.io.filefilter.IOFileFilter,%20int)">DirectoryWalker</a></strong>(<a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a>&nbsp;directoryFilter,
               <a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a>&nbsp;fileFilter,
               int&nbsp;depthLimit)</code>
<div class="block">Construct an instance with a directory and a file filter and an optional
 limit on the <i>depth</i> navigated to.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/io/DirectoryWalker.html#checkIfCancelled(java.io.File,%20int,%20java.util.Collection)">checkIfCancelled</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file,
                int&nbsp;depth,
                <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results)</code>
<div class="block">Checks whether the walk has been cancelled by calling <a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleIsCancelled(java.io.File,%20int,%20java.util.Collection)"><code>handleIsCancelled(java.io.File, int, java.util.Collection&lt;T&gt;)</code></a>,
 throwing a <code>CancelException</code> if it has.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/io/DirectoryWalker.html#filterDirectoryContents(java.io.File,%20int,%20java.io.File[])">filterDirectoryContents</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory,
                       int&nbsp;depth,
                       <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>[]&nbsp;files)</code>
<div class="block">Overridable callback method invoked with the contents of each directory.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleCancelled(java.io.File,%20java.util.Collection,%20org.apache.commons.io.DirectoryWalker.CancelException)">handleCancelled</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;startDirectory,
               <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results,
               <a href="../../../../org/apache/commons/io/DirectoryWalker.CancelException.html" title="class in org.apache.commons.io">DirectoryWalker.CancelException</a>&nbsp;cancel)</code>
<div class="block">Overridable callback method invoked when the operation is cancelled.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleDirectory(java.io.File,%20int,%20java.util.Collection)">handleDirectory</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory,
               int&nbsp;depth,
               <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results)</code>
<div class="block">Overridable callback method invoked to determine if a directory should be processed.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleDirectoryEnd(java.io.File,%20int,%20java.util.Collection)">handleDirectoryEnd</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory,
                  int&nbsp;depth,
                  <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results)</code>
<div class="block">Overridable callback method invoked at the end of processing each directory.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleDirectoryStart(java.io.File,%20int,%20java.util.Collection)">handleDirectoryStart</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory,
                    int&nbsp;depth,
                    <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results)</code>
<div class="block">Overridable callback method invoked at the start of processing each directory.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleEnd(java.util.Collection)">handleEnd</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results)</code>
<div class="block">Overridable callback method invoked at the end of processing.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleFile(java.io.File,%20int,%20java.util.Collection)">handleFile</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file,
          int&nbsp;depth,
          <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results)</code>
<div class="block">Overridable callback method invoked for each (non-directory) file.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleIsCancelled(java.io.File,%20int,%20java.util.Collection)">handleIsCancelled</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file,
                 int&nbsp;depth,
                 <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results)</code>
<div class="block">Overridable callback method invoked to determine if the entire walk
 operation should be immediately cancelled.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleRestricted(java.io.File,%20int,%20java.util.Collection)">handleRestricted</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory,
                int&nbsp;depth,
                <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results)</code>
<div class="block">Overridable callback method invoked for each restricted directory.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleStart(java.io.File,%20java.util.Collection)">handleStart</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;startDirectory,
           <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results)</code>
<div class="block">Overridable callback method invoked at the start of processing.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected void</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/io/DirectoryWalker.html#walk(java.io.File,%20java.util.Collection)">walk</a></strong>(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;startDirectory,
    <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results)</code>
<div class="block">Internal method that walks the directory hierarchy in a depth-first manner.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="DirectoryWalker()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DirectoryWalker</h4>
<pre>protected&nbsp;DirectoryWalker()</pre>
<div class="block">Construct an instance with no filtering and unlimited <i>depth</i>.</div>
</li>
</ul>
<a name="DirectoryWalker(java.io.FileFilter, int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>DirectoryWalker</h4>
<pre>protected&nbsp;DirectoryWalker(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/FileFilter.html?is-external=true" title="class or interface in java.io">FileFilter</a>&nbsp;filter,
               int&nbsp;depthLimit)</pre>
<div class="block">Construct an instance with a filter and limit the <i>depth</i> navigated to.
 <p>
 The filter controls which files and directories will be navigated to as
 part of the walk. The <a href="../../../../org/apache/commons/io/filefilter/FileFilterUtils.html" title="class in org.apache.commons.io.filefilter"><code>FileFilterUtils</code></a> class is useful for combining
 various filters together. A <code>null</code> filter means that no
 filtering should occur and all files and directories will be visited.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>filter</code> - the filter to apply, null means visit all files</dd><dd><code>depthLimit</code> - controls how <i>deep</i> the hierarchy is
  navigated to (less than 0 means unlimited)</dd></dl>
</li>
</ul>
<a name="DirectoryWalker(org.apache.commons.io.filefilter.IOFileFilter, org.apache.commons.io.filefilter.IOFileFilter, int)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>DirectoryWalker</h4>
<pre>protected&nbsp;DirectoryWalker(<a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a>&nbsp;directoryFilter,
               <a href="../../../../org/apache/commons/io/filefilter/IOFileFilter.html" title="interface in org.apache.commons.io.filefilter">IOFileFilter</a>&nbsp;fileFilter,
               int&nbsp;depthLimit)</pre>
<div class="block">Construct an instance with a directory and a file filter and an optional
 limit on the <i>depth</i> navigated to.
 <p>
 The filters control which files and directories will be navigated to as part
 of the walk. This constructor uses <a href="../../../../org/apache/commons/io/filefilter/FileFilterUtils.html#makeDirectoryOnly(org.apache.commons.io.filefilter.IOFileFilter)"><code>FileFilterUtils.makeDirectoryOnly(IOFileFilter)</code></a>
 and <a href="../../../../org/apache/commons/io/filefilter/FileFilterUtils.html#makeFileOnly(org.apache.commons.io.filefilter.IOFileFilter)"><code>FileFilterUtils.makeFileOnly(IOFileFilter)</code></a> internally to combine the filters.
 A <code>null</code> filter means that no filtering should occur.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>directoryFilter</code> - the filter to apply to directories, null means visit all directories</dd><dd><code>fileFilter</code> - the filter to apply to files, null means visit all files</dd><dd><code>depthLimit</code> - controls how <i>deep</i> the hierarchy is
  navigated to (less than 0 means unlimited)</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="walk(java.io.File, java.util.Collection)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>walk</h4>
<pre>protected final&nbsp;void&nbsp;walk(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;startDirectory,
        <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results)
                   throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Internal method that walks the directory hierarchy in a depth-first manner.
 <p>
 Users of this class do not need to call this method. This method will
 be called automatically by another (public) method on the specific subclass.
 <p>
 Writers of subclasses should call this method to start the directory walk.
 Once called, this method will emit events as it walks the hierarchy.
 The event methods have the prefix <code>handle</code>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>startDirectory</code> - the directory to start from, not null</dd><dd><code>results</code> - the collection of result objects, may be updated</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if the start directory is null</dd>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd></dl>
</li>
</ul>
<a name="checkIfCancelled(java.io.File, int, java.util.Collection)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>checkIfCancelled</h4>
<pre>protected final&nbsp;void&nbsp;checkIfCancelled(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file,
                    int&nbsp;depth,
                    <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results)
                               throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Checks whether the walk has been cancelled by calling <a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleIsCancelled(java.io.File,%20int,%20java.util.Collection)"><code>handleIsCancelled(java.io.File, int, java.util.Collection&lt;T&gt;)</code></a>,
 throwing a <code>CancelException</code> if it has.
 <p>
 Writers of subclasses should not normally call this method as it is called
 automatically by the walk of the tree. However, sometimes a single method,
 typically <a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleFile(java.io.File,%20int,%20java.util.Collection)"><code>handleFile(java.io.File, int, java.util.Collection&lt;T&gt;)</code></a>, may take a long time to run. In that case,
 you may wish to check for cancellation by calling this method.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>file</code> - the current file being processed</dd><dd><code>depth</code> - the current file level (starting directory = 0)</dd><dd><code>results</code> - the collection of result objects, may be updated</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd></dl>
</li>
</ul>
<a name="handleIsCancelled(java.io.File, int, java.util.Collection)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>handleIsCancelled</h4>
<pre>protected&nbsp;boolean&nbsp;handleIsCancelled(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file,
                        int&nbsp;depth,
                        <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results)
                             throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Overridable callback method invoked to determine if the entire walk
 operation should be immediately cancelled.
 <p>
 This method should be implemented by those subclasses that want to
 provide a public <code>cancel()</code> method available from another
 thread. The design pattern for the subclass should be as follows:
 <pre>
  public class FooDirectoryWalker extends DirectoryWalker {
    private volatile boolean cancelled = false;

    public void cancel() {
        cancelled = true;
    }
    private void handleIsCancelled(File file, int depth, Collection results) {
        return cancelled;
    }
    protected void handleCancelled(File startDirectory,
              Collection results, CancelException cancel) {
        // implement processing required when a cancellation occurs
    }
  }
 </pre>
 <p>
 If this method returns true, then the directory walk is immediately
 cancelled. The next callback method will be <a href="../../../../org/apache/commons/io/DirectoryWalker.html#handleCancelled(java.io.File,%20java.util.Collection,%20org.apache.commons.io.DirectoryWalker.CancelException)"><code>handleCancelled(java.io.File, java.util.Collection&lt;T&gt;, org.apache.commons.io.DirectoryWalker.CancelException)</code></a>.
 <p>
 This implementation returns false.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>file</code> - the file or directory being processed</dd><dd><code>depth</code> - the current directory level (starting directory = 0)</dd><dd><code>results</code> - the collection of result objects, may be updated</dd>
<dt><span class="strong">Returns:</span></dt><dd>true if the walk has been cancelled</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd></dl>
</li>
</ul>
<a name="handleCancelled(java.io.File, java.util.Collection, org.apache.commons.io.DirectoryWalker.CancelException)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>handleCancelled</h4>
<pre>protected&nbsp;void&nbsp;handleCancelled(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;startDirectory,
                   <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results,
                   <a href="../../../../org/apache/commons/io/DirectoryWalker.CancelException.html" title="class in org.apache.commons.io">DirectoryWalker.CancelException</a>&nbsp;cancel)
                        throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Overridable callback method invoked when the operation is cancelled.
 The file being processed when the cancellation occurred can be
 obtained from the exception.
 <p>
 This implementation just re-throws the <a href="../../../../org/apache/commons/io/DirectoryWalker.CancelException.html" title="class in org.apache.commons.io"><code>DirectoryWalker.CancelException</code></a>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>startDirectory</code> - the directory that the walk started from</dd><dd><code>results</code> - the collection of result objects, may be updated</dd><dd><code>cancel</code> - the exception throw to cancel further processing
 containing details at the point of cancellation.</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd></dl>
</li>
</ul>
<a name="handleStart(java.io.File, java.util.Collection)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>handleStart</h4>
<pre>protected&nbsp;void&nbsp;handleStart(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;startDirectory,
               <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results)
                    throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Overridable callback method invoked at the start of processing.
 <p>
 This implementation does nothing.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>startDirectory</code> - the directory to start from</dd><dd><code>results</code> - the collection of result objects, may be updated</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd></dl>
</li>
</ul>
<a name="handleDirectory(java.io.File, int, java.util.Collection)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>handleDirectory</h4>
<pre>protected&nbsp;boolean&nbsp;handleDirectory(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory,
                      int&nbsp;depth,
                      <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results)
                           throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Overridable callback method invoked to determine if a directory should be processed.
 <p>
 This method returns a boolean to indicate if the directory should be examined or not.
 If you return false, the entire directory and any subdirectories will be skipped.
 Note that this functionality is in addition to the filtering by file filter.
 <p>
 This implementation does nothing and returns true.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>directory</code> - the current directory being processed</dd><dd><code>depth</code> - the current directory level (starting directory = 0)</dd><dd><code>results</code> - the collection of result objects, may be updated</dd>
<dt><span class="strong">Returns:</span></dt><dd>true to process this directory, false to skip this directory</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd></dl>
</li>
</ul>
<a name="handleDirectoryStart(java.io.File, int, java.util.Collection)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>handleDirectoryStart</h4>
<pre>protected&nbsp;void&nbsp;handleDirectoryStart(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory,
                        int&nbsp;depth,
                        <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results)
                             throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Overridable callback method invoked at the start of processing each directory.
 <p>
 This implementation does nothing.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>directory</code> - the current directory being processed</dd><dd><code>depth</code> - the current directory level (starting directory = 0)</dd><dd><code>results</code> - the collection of result objects, may be updated</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd></dl>
</li>
</ul>
<a name="filterDirectoryContents(java.io.File, int, java.io.File[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>filterDirectoryContents</h4>
<pre>protected&nbsp;<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>[]&nbsp;filterDirectoryContents(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory,
                             int&nbsp;depth,
                             <a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>[]&nbsp;files)
                                  throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Overridable callback method invoked with the contents of each directory.
 <p>
 This implementation returns the files unchanged</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>directory</code> - the current directory being processed</dd><dd><code>depth</code> - the current directory level (starting directory = 0)</dd><dd><code>files</code> - the files (possibly filtered) in the directory, may be <code>null</code></dd>
<dt><span class="strong">Returns:</span></dt><dd>the filtered list of files</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd><dt><span class="strong">Since:</span></dt>
  <dd>2.0</dd></dl>
</li>
</ul>
<a name="handleFile(java.io.File, int, java.util.Collection)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>handleFile</h4>
<pre>protected&nbsp;void&nbsp;handleFile(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;file,
              int&nbsp;depth,
              <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results)
                   throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Overridable callback method invoked for each (non-directory) file.
 <p>
 This implementation does nothing.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>file</code> - the current file being processed</dd><dd><code>depth</code> - the current directory level (starting directory = 0)</dd><dd><code>results</code> - the collection of result objects, may be updated</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd></dl>
</li>
</ul>
<a name="handleRestricted(java.io.File, int, java.util.Collection)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>handleRestricted</h4>
<pre>protected&nbsp;void&nbsp;handleRestricted(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory,
                    int&nbsp;depth,
                    <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results)
                         throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Overridable callback method invoked for each restricted directory.
 <p>
 This implementation does nothing.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>directory</code> - the restricted directory</dd><dd><code>depth</code> - the current directory level (starting directory = 0)</dd><dd><code>results</code> - the collection of result objects, may be updated</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd></dl>
</li>
</ul>
<a name="handleDirectoryEnd(java.io.File, int, java.util.Collection)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>handleDirectoryEnd</h4>
<pre>protected&nbsp;void&nbsp;handleDirectoryEnd(<a href="http://docs.oracle.com/javase/7/docs/api/java/io/File.html?is-external=true" title="class or interface in java.io">File</a>&nbsp;directory,
                      int&nbsp;depth,
                      <a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results)
                           throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Overridable callback method invoked at the end of processing each directory.
 <p>
 This implementation does nothing.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>directory</code> - the directory being processed</dd><dd><code>depth</code> - the current directory level (starting directory = 0)</dd><dd><code>results</code> - the collection of result objects, may be updated</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd></dl>
</li>
</ul>
<a name="handleEnd(java.util.Collection)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>handleEnd</h4>
<pre>protected&nbsp;void&nbsp;handleEnd(<a href="http://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/io/DirectoryWalker.html" title="type parameter in DirectoryWalker">T</a>&gt;&nbsp;results)
                  throws <a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></pre>
<div class="block">Overridable callback method invoked at the end of processing.
 <p>
 This implementation does nothing.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>results</code> - the collection of result objects, may be updated</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/7/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an I/O Error occurs</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/DirectoryWalker.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/commons/io/CopyUtils.html" title="class in org.apache.commons.io"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/commons/io/DirectoryWalker.CancelException.html" title="class in org.apache.commons.io"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/commons/io/DirectoryWalker.html" target="_top">Frames</a></li>
<li><a href="DirectoryWalker.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested_class_summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2002&#x2013;2016 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
